package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.MarketStorage;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.service.wx.WxStorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;

/**
 * @author : qj
 * @since: 2022/10/15  11:34
 */

@RestController
@RequestMapping("wx/storage")
public class WxStorageController {

    @Autowired
    WxStorageService wxStorageService;

    @PostMapping("upload")
    public BaseRespVo uploadFile(MultipartFile file) throws IOException {

        MarketStorage wxStorageVo = wxStorageService.uploadFile(file);

        return BaseRespVo.ok(wxStorageVo,"成功");

    }
}
